<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:s="http://jboss.com/products/seam/taglib"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:rich="http://richfaces.org/rich"
    template="layout/template.xhtml">

<ui:define name="body">

    <rich:panel>
        <f:facet name="header">Tarefa Details</f:facet>


        <s:decorate id="fim" template="layout/display.xhtml">
            <ui:define name="label">Fim</ui:define>
            <h:outputText value="#{tarefaHome.instance.fim}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="inicio" template="layout/display.xhtml">
            <ui:define name="label">Inicio</ui:define>
            <h:outputText value="#{tarefaHome.instance.inicio}">
                <s:convertDateTime type="both" dateStyle="short"/>
            </h:outputText>
        </s:decorate>

        <s:decorate id="milestone" template="layout/display.xhtml">
            <ui:define name="label">Milestone</ui:define>
            <h:outputText value="#{tarefaHome.instance.milestone}"/>
        </s:decorate>

        <s:decorate id="nome" template="layout/display.xhtml">
            <ui:define name="label">Nome</ui:define>
            <h:outputText value="#{tarefaHome.instance.nome}"/>
        </s:decorate>

        <s:decorate id="porcentcomp" template="layout/display.xhtml">
            <ui:define name="label">Porcentcomp</ui:define>
            <h:outputText value="#{tarefaHome.instance.porcentcomp}"/>
        </s:decorate>

        <div style="clear:both"/>

    </rich:panel>

    <div class="actionButtons">

        <s:button view="/TarefaEdit.xhtml"
                    id="edit"
                 value="Edit"/>

        <s:button view="/#{empty tarefaFrom ? 'TarefaList' : tarefaFrom}.xhtml"
                    id="done"
                 value="Done"/>

    </div>

    <rich:tabPanel switchType="ajax">

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/manytoone.gif" style="vertical-align: middle; padding-right: 4px;"/>Projeto</h:panelGroup>
        </f:facet>
    <div class="association" id="projetoParent">

        <h:outputText value="There is no projeto associated with this tarefa."
                   rendered="#{tarefaHome.instance.projeto == null}"/>

        <rich:dataTable var="_projeto"
                   value="#{tarefaHome.instance.projeto}"
                rendered="#{tarefaHome.instance.projeto != null}"
              rowClasses="rvgRowOne,rvgRowTwo"
                      id="projetoTable">
            <h:column>
                <f:facet name="header">Id</f:facet>
                <h:outputText value="#{_projeto.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Statusprojeto id</f:facet>
                <h:outputText value="#{_projeto.statusprojeto.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Usuario id</f:facet>
                <h:outputText value="#{_projeto.usuario.id}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Cliente</f:facet>
                <h:outputText value="#{_projeto.cliente}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Custoprevisto</f:facet>
                <h:outputText value="#{_projeto.custoprevisto}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Datacriacao</f:facet>
                <h:outputText value="#{_projeto.datacriacao}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Fim</f:facet>
                <h:outputText value="#{_projeto.fim}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Fimprevisto</f:facet>
                <h:outputText value="#{_projeto.fimprevisto}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Inicio</f:facet>
                <h:outputText value="#{_projeto.inicio}">
                    <s:convertDateTime type="both" dateStyle="short"/>
                </h:outputText>
            </h:column>
            <h:column>
                <f:facet name="header">Justificativa</f:facet>
                <h:outputText value="#{_projeto.justificativa}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Necessidades</f:facet>
                <h:outputText value="#{_projeto.necessidades}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Nome</f:facet>
                <h:outputText value="#{_projeto.nome}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Orcamento</f:facet>
                <h:outputText value="#{_projeto.orcamento}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Premissas</f:facet>
                <h:outputText value="#{_projeto.premissas}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Produto</f:facet>
                <h:outputText value="#{_projeto.produto}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Responsabilidadesgp</f:facet>
                <h:outputText value="#{_projeto.responsabilidadesgp}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Restricoes</f:facet>
                <h:outputText value="#{_projeto.restricoes}"/>
            </h:column>
            <h:column>
                <f:facet name="header">Resumo</f:facet>
                <h:outputText value="#{_projeto.resumo}"/>
            </h:column>
            <h:column styleClass="action">
                <f:facet name="header">Action</f:facet>
                <s:link id="viewprojeto"
                     value="View"
                      view="/Projeto.xhtml">
                    <f:param name="projetoId"
                           value="#{_projeto.id}"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Subtarefas for subtarefaid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="subtarefasForSubtarefaidChildren">

        <h:outputText value="There are no subtarefasForSubtarefaid associated with this tarefa."
                   rendered="#{empty tarefaHome.subtarefasForSubtarefaid}"/>

        <rich:dataTable value="#{tarefaHome.subtarefasForSubtarefaid}"
                       var="_subtarefa"
                  rendered="#{not empty tarefaHome.subtarefasForSubtarefaid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="subtarefasForSubtarefaidTable">
            <rich:column sortBy="#{_subtarefa.id.subtarefaid}">
                <f:facet name="header">Subtarefaid</f:facet>
                <h:outputText value="#{_subtarefa.id.subtarefaid}"/>
            </rich:column>
            <rich:column sortBy="#{_subtarefa.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_subtarefa.id.tarefaid}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectsubtarefa"
                     value="Select"
                      view="/Subtarefa.xhtml">
                    <f:param name="subtarefaSubtarefaid"
                            value="#{_subtarefa.id.subtarefaid}"/>
                    <f:param name="subtarefaTarefaid"
                            value="#{_subtarefa.id.tarefaid}"/>
                    <f:param name="subtarefaFrom" value="Tarefa"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add subtarefa"
                view="/SubtarefaEdit.xhtml">
            <f:param name="tarefaId"
                    value="#{tarefaHome.instance.id}"/>
            <f:param name="subtarefaFrom" value="Tarefa"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Tarefapredecessoras for tarefaid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="tarefapredecessorasForTarefaidChildren">

        <h:outputText value="There are no tarefapredecessorasForTarefaid associated with this tarefa."
                   rendered="#{empty tarefaHome.tarefapredecessorasForTarefaid}"/>

        <rich:dataTable value="#{tarefaHome.tarefapredecessorasForTarefaid}"
                       var="_tarefapredecessora"
                  rendered="#{not empty tarefaHome.tarefapredecessorasForTarefaid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="tarefapredecessorasForTarefaidTable">
            <rich:column sortBy="#{_tarefapredecessora.id.tarefapredecessoraid}">
                <f:facet name="header">Tarefapredecessoraid</f:facet>
                <h:outputText value="#{_tarefapredecessora.id.tarefapredecessoraid}"/>
            </rich:column>
            <rich:column sortBy="#{_tarefapredecessora.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_tarefapredecessora.id.tarefaid}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selecttarefapredecessora"
                     value="Select"
                      view="/Tarefapredecessora.xhtml">
                    <f:param name="tarefapredecessoraTarefapredecessoraid"
                            value="#{_tarefapredecessora.id.tarefapredecessoraid}"/>
                    <f:param name="tarefapredecessoraTarefaid"
                            value="#{_tarefapredecessora.id.tarefaid}"/>
                    <f:param name="tarefapredecessoraFrom" value="Tarefa"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add tarefapredecessora"
                view="/TarefapredecessoraEdit.xhtml">
            <f:param name="tarefaId"
                    value="#{tarefaHome.instance.id}"/>
            <f:param name="tarefapredecessoraFrom" value="Tarefa"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Tarefapredecessoras for tarefapredecessoraid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="tarefapredecessorasForTarefapredecessoraidChildren">

        <h:outputText value="There are no tarefapredecessorasForTarefapredecessoraid associated with this tarefa."
                   rendered="#{empty tarefaHome.tarefapredecessorasForTarefapredecessoraid}"/>

        <rich:dataTable value="#{tarefaHome.tarefapredecessorasForTarefapredecessoraid}"
                       var="_tarefapredecessora"
                  rendered="#{not empty tarefaHome.tarefapredecessorasForTarefapredecessoraid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="tarefapredecessorasForTarefapredecessoraidTable">
            <rich:column sortBy="#{_tarefapredecessora.id.tarefapredecessoraid}">
                <f:facet name="header">Tarefapredecessoraid</f:facet>
                <h:outputText value="#{_tarefapredecessora.id.tarefapredecessoraid}"/>
            </rich:column>
            <rich:column sortBy="#{_tarefapredecessora.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_tarefapredecessora.id.tarefaid}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selecttarefapredecessora"
                     value="Select"
                      view="/Tarefapredecessora.xhtml">
                    <f:param name="tarefapredecessoraTarefapredecessoraid"
                            value="#{_tarefapredecessora.id.tarefapredecessoraid}"/>
                    <f:param name="tarefapredecessoraTarefaid"
                            value="#{_tarefapredecessora.id.tarefaid}"/>
                    <f:param name="tarefapredecessoraFrom" value="Tarefa"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add tarefapredecessora"
                view="/TarefapredecessoraEdit.xhtml">
            <f:param name="tarefaId"
                    value="#{tarefaHome.instance.id}"/>
            <f:param name="tarefapredecessoraFrom" value="Tarefa"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Subtarefas for tarefaid</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="subtarefasForTarefaidChildren">

        <h:outputText value="There are no subtarefasForTarefaid associated with this tarefa."
                   rendered="#{empty tarefaHome.subtarefasForTarefaid}"/>

        <rich:dataTable value="#{tarefaHome.subtarefasForTarefaid}"
                       var="_subtarefa"
                  rendered="#{not empty tarefaHome.subtarefasForTarefaid}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="subtarefasForTarefaidTable">
            <rich:column sortBy="#{_subtarefa.id.subtarefaid}">
                <f:facet name="header">Subtarefaid</f:facet>
                <h:outputText value="#{_subtarefa.id.subtarefaid}"/>
            </rich:column>
            <rich:column sortBy="#{_subtarefa.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_subtarefa.id.tarefaid}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectsubtarefa"
                     value="Select"
                      view="/Subtarefa.xhtml">
                    <f:param name="subtarefaSubtarefaid"
                            value="#{_subtarefa.id.subtarefaid}"/>
                    <f:param name="subtarefaTarefaid"
                            value="#{_subtarefa.id.tarefaid}"/>
                    <f:param name="subtarefaFrom" value="Tarefa"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add subtarefa"
                view="/SubtarefaEdit.xhtml">
            <f:param name="tarefaId"
                    value="#{tarefaHome.instance.id}"/>
            <f:param name="subtarefaFrom" value="Tarefa"/>
        </s:button>
    </div>
    </rich:tab>

    <rich:tab>
        <f:facet name="label">
            <h:panelGroup><h:graphicImage value="/img/onetomany.gif" style="vertical-align: middle; padding-right: 4px;"/>Utilizacaorecursos</h:panelGroup>
        </f:facet>
    <h:form styleClass="association" id="utilizacaorecursosChildren">

        <h:outputText value="There are no utilizacaorecursos associated with this tarefa."
                   rendered="#{empty tarefaHome.utilizacaorecursos}"/>

        <rich:dataTable value="#{tarefaHome.utilizacaorecursos}"
                       var="_utilizacaorecurso"
                  rendered="#{not empty tarefaHome.utilizacaorecursos}"
                rowClasses="rvgRowOne,rvgRowTwo"
                        id="utilizacaorecursosTable">
            <rich:column sortBy="#{_utilizacaorecurso.id.recursoid}">
                <f:facet name="header">Recursoid</f:facet>
                <h:outputText value="#{_utilizacaorecurso.id.recursoid}"/>
            </rich:column>
            <rich:column sortBy="#{_utilizacaorecurso.id.tarefaid}">
                <f:facet name="header">Tarefaid</f:facet>
                <h:outputText value="#{_utilizacaorecurso.id.tarefaid}"/>
            </rich:column>
            <rich:column sortBy="#{_utilizacaorecurso.custo}">
                <f:facet name="header">Custo</f:facet>
                <h:outputText value="#{_utilizacaorecurso.custo}"/>
            </rich:column>
            <h:column>
                <f:facet name="header">Action</f:facet>
                <s:link id="selectutilizacaorecurso"
                     value="Select"
                      view="/Utilizacaorecurso.xhtml">
                    <f:param name="utilizacaorecursoRecursoid"
                            value="#{_utilizacaorecurso.id.recursoid}"/>
                    <f:param name="utilizacaorecursoTarefaid"
                            value="#{_utilizacaorecurso.id.tarefaid}"/>
                    <f:param name="utilizacaorecursoFrom" value="Tarefa"/>
                </s:link>
            </h:column>
        </rich:dataTable>

    </h:form>

    <div class="actionButtons">
        <s:button
               value="Add utilizacaorecurso"
                view="/UtilizacaorecursoEdit.xhtml">
            <f:param name="tarefaId"
                    value="#{tarefaHome.instance.id}"/>
            <f:param name="utilizacaorecursoFrom" value="Tarefa"/>
        </s:button>
    </div>
    </rich:tab>
</rich:tabPanel>
</ui:define>

</ui:composition>
